<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Register Form</title>
<script language="javascript">
	function check()	{

		var name = register.user.value;
		var pass = register.pass.value;
		var pass2 = register.pass2.value;
		var tsPass= /^\d{6,12}$/;
 		var mail = register.mail.value;
 		var fullName = register.fullname.value;
 		var tsmail=/^[a-zA-Z][\w\.]*@[a-zA-Z]{2,10}\.[a-zA-Z]{2,4}$/;
 		var tel = register.tel.value;
 		var tsTel=/^\d{9,15}$/;
 		var add = register.add.value; 	
 	
 		if (name == "")	{
 			alert("UserName can't null");
 			register.user.focus();
 			return false;
 		}
 		if (pass == "")	{
 			alert("Password can't null");
 			register.pass.focus();
 			return false;
 		}
 		if (tsPass.test(pass) == false) {
 			alert("Password required to 6 - 12 character");
 			register.pass.value = "";
 			register.pass.focus();
 			return false;
 		}
 		if (pass2 == "")	{
 			alert("Password confirm is null");
 			register.pass2.focus();
 			return false;
 		}
 		if (pass != pass2)	{
 			alert("Password confirm invaild");
 			register.pass2.value = "";
 			register.pass2.focus();
 			return false;
 		}
 		if (mail == "")	{
 			alert("email is null");
 			register.mail.focus();
 			return false;
 		}
 		if (tsmail.test(mail) == false) {
 			alert("Email invaild format .Ex : abcd@efdg.com");
 			register.mail.value = "";
 			register.mail.focus();
 			return false;
 		}
 		if (fullname == "")	{
 			alert("Fullname is null");
 			register.mail.focus();
 			return false;
 		}
 		if (register.birthday.value == "")	{
 			alert("Birthday is null");
 			register.birthday.focus();
 			return false;
 		}
 		if (tel == "")	{
 			alert("Phone is null");
 			register.tel.focus();
 			return false;
 		}
 		if (tsTel.test(tel) == false)	{
 			alert("Tel format invaild );
 			register.tel.value == "";
 			register.tel.focus();
 			return false;
 		}
 	}
</script>
<style>
	.mes {
		color:red;
		font-size:11px;
	}
</style>
<head>
<body>
<form name="register" method="POST" action="abcd.jsp" onsubmit="return check(this)"	>
 	<table style="boder:1px solid blue" width="80%" align="center">
 	<tr>
 		<td colspan="2" align="center"><h1>Register Member</h1></td>
 	</tr>
 	 	<tr>
 		<td colspan="2">&nbsp;&nbsp;&nbsp;<td>
 	<tr>
 	 	<tr>
 		<td colspan="2">&nbsp;&nbsp;&nbsp;<td>
 	<tr>
 	<tr>
 		<td colspan="2">Member Information</td>
 	</tr>
 	<tr>
 		<td colspan="2">&nbsp;&nbsp;&nbsp;<td>
 	<tr>
 	<tr>
 		<td>
 			User Name : <span class="mes">*</span>
 		</td>
 		<td>
 			<input type="text" name="user" size="30">
 			
 		</td>
 	</tr>
 	<tr>
 		<td>
 			Password : <span class="mes"> *</span>
 		</td>
 		<td>
 			<input type="password" name="pass" size="30">
 			
 		</td>
 	</tr>
 	 	<tr>
 		<td>
 			Confirm Password : <span class="mes"> *</span>
 		</td>
 		<td>
 			<input type="password" name="pass2" size="30"> 			
 		</td>
 	</tr>
 	<tr>
 		<td>Email : <span class="mes"> *</span></td>
 		<td>
 			<input type="text" name="mail" size="30"> 			
 		</td>
 	</tr>
 	 	 	<tr>
 		<td colspan="2">&nbsp;</td>
 	</tr>
 	<tr>
 		<td colspan="2">Contact Member</td>
 	</tr>
 	 	 	<tr>
 		<td colspan="2">&nbsp;</td>
 	</tr>
 	<tr>
 		<td>
 			FullName : <span class="mes"> *</span>
 		</td>
 		<td>
 			<input type="text" name="fullname" size="30" >
 		</td>
 	</tr>
 	<tr>
 		<td>
 			Sex : <span class="mes"> *</span>
 		</td>	
 		<td>
 			<input type="radio" name="sex" value="1" checked="checked" /> Female
 			<input type="radio" name="sex" value="0" /> Male
 		</td>
 	</tr>
 	<tr>
 		<td>
 			Birthday : 
 		</td>
 		<td>
 			<input type="text" name="birthday" size="30" value="dd/mm/yyyy" >
 		</td> 	
 		</tr>
 		<tr>
 			<td>
 				Address : 
 			</td>
 			<td>
 				<textarea name="add" cols="30" rows="5"></textarea>
 			</td>
 		</tr>
 		 	<tr>
 		<td>
 			Telephone : <span class="mes"> *</span>
 		</td>
 		<td>
 			<input type="text" name="tel" size="30" >
 		</td>
 	</tr>
 	<tr>
 		<td colspan="2">&nbsp;</td>
 	</tr>
 	 	<tr>
 		<td colspan="2">&nbsp;</td>
 	</tr>
 	<tr>
 		<td></td>
 		<td>
 			<input type="submit" value=" Submit " name="submit">
 			<input type="reset" value=" Reset " name="reset" >
 		</td>
 	</tr>
 	</table>
</form> 	
</body>
</html>
